;var module = angular.module('CtrlsContent');
module.controller('TongguanCtrl',['$scope','api_other','$state',function($scope,api_other,$state){
	$scope.listModel = [];
	$scope.event = {
		get:function(){
			var obj  = {
				cat_id:localStorage.catId
			};
			var promise = api_other.bookList(obj);
			promise.success(function(data){
				if(data.returnCode == 0){
					$scope.listModel = data.returnData;
					localStorage.IsShare = localStorage.IsShare || 1;
				}
			})
		},
		pay:function(item){
			localStorage.goods_id = item.id;
			localStorage.price = item.price;
			localStorage.share_price = item.share_price;
			localStorage.IsShare = localStorage.IsShare || 2;
			$state.go('tongguanbuy');
		}
	};
	$scope.event.get();
}]);